package cn.edu.stu.syllabus.repository.oaFile.local;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by daidaijie on 2017/3/23.
 */

public class OaFileEntry implements Parcelable {

    private String fileType;

    private String fileName;

    private String fileLink;

    public String getFileType() {
        return fileType;
    }

    public String getShortFileType() {
        String shortFileType = fileType;
        if (fileType.length() > 5) {
            shortFileType = shortFileType.substring(0, 5);
        }
        return shortFileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileLink() {
        return fileLink;
    }

    public void setFileLink(String fileLink) {
        this.fileLink = fileLink;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.fileType);
        dest.writeString(this.fileName);
        dest.writeString(this.fileLink);
    }

    public OaFileEntry() {
    }

    protected OaFileEntry(Parcel in) {
        this.fileType = in.readString();
        this.fileName = in.readString();
        this.fileLink = in.readString();
    }

    public static final Parcelable.Creator<OaFileEntry> CREATOR = new Parcelable.Creator<OaFileEntry>() {
        @Override
        public OaFileEntry createFromParcel(Parcel source) {
            return new OaFileEntry(source);
        }

        @Override
        public OaFileEntry[] newArray(int size) {
            return new OaFileEntry[size];
        }
    };
}
